fix(audit): resolve HIGH + MEDIUM + perf/correctness findings from multi-agent repo audit#185
Merged
Merged
Conversation
…lti-agent repo audit A 13-subsystem multi-agent audit (adversarially verified, 18 findings refuted) surfaced 86 confirmed issues. This resolves the 1 HIGH, all 16 MEDIUM, and the high-value perf/low/doc items — ~42 findings — each with regression tests. Full suite: 1558 pass. Swift runner build-for-testing SUCCEEDED. The multi-renderer getTree fix was live-verified on the booted Bridgeless+Reanimated test app over CDP. HIGH - collect-feedback.sh redact() failed OPEN on macOS (invalid sed bracket range) leaking ghp_/AKIA/JWT/Bearer/sk_ secrets into public feedback issues — now one sed program that fails CLOSED ([REDACTION_FAILED]); + bash regression test. MEDIUM (correctness/inconsistency) - device_batch swipe was a scroll; now a real swipe gesture honoring duration - runIOS/postCommand + android client: AbortController per-command HTTP timeout - ref-map @ref coords gated on snapshot age (isRefMapFresh) -> STALE_REF when stale - iOS raw screenshot honors png format via extension; NaN tap coords rejected - repair-engine extract/replaceIdSelector match the maestro-error-parser quoted-id grammar (quoted/commented testIDs no longer skip auto-repair) - experience: candidate-id regex matches real filenames; imported heuristic ids deduped; ghost recovery gated to idempotent tools; redaction catches quoted-JSON /object-auth secrets; PII regex no longer over-redacts bare numbers - cross_platform_verify FAIL returns ok:false (was warnResult/ok:true) - runMaestroInline routes through chooseMaestroDispatch (B59 iOS-only fallback) - injected getTree() unfiltered branch walks ALL renderers (B143/B145) - nav-graph strikes namespaced per project (no cross-project cooldown poisoning) - swift textInputAt restricts query to input types; eas_resolve_artifact.sh portable stat PERF - meta.timings_ms helper + scrollintoview instrumentation (CLAUDE.md mandate) - object_inspect concurrent child fetch; nav_graph go single graph read (was 4x) - connect candidate loop O(n^2) indexOf -> indexed; auto-login polls instead of 3s wait LOW / correctness + docs - guarded JSON.parse (navigation-state, android client); navigateTo loop depth cap - sidecar missing lastSeenMtimeMs re-seeded (re-enables human-edit guard) - proof_step no-session verify -> verified:false; device_record path-traversal guard - device_find surfaces recoveredTier on NOT_FOUND/AMBIGUOUS; detectPrerequisites whole-word permission match; learned-actions --max NaN fallback; collect-feedback grep double-zero fix; iOS /health probe 127.0.0.1 (was [::1]) - tool-count drift (banner 51, CLAUDE.md 74 -> 75); REACT_READY renderer range 1-5 -> 1-20 - repair budget refusal reports 24h-windowed count, not lifetime total Swift (xcodebuild build-for-testing verified) - rn-fast-runner answers GET /health directly (was unparseable -> liveness always stale) - snapshotHasFocus uses `as?` not `as!` (force-cast trap is uncatchable) Deferred (~20 moderate-risk perf + cosmetic items) tracked for a focused follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to the audit fixes — addresses the remaining lower-severity items. Full suite still 1558 pass; tsc clean. Perf/lifecycle: logger buffered WriteStream (no event-loop block); connectWs backstop terminates a wedged socket (no leak); cdp_network_log truncated/total accurate on the unfiltered path via buffer size. Correctness/clarity: maestro_run pass/fail no longer false-flags benign 'Error:' (exit code authoritative); fingerprint engine = Hermes only with an RN signal else null; groupFailures unreachable passed++ removed; multiplexer debug-logs unrouted-id drops; RunIOSArgs dead x1/y1 removed; path-safety sidecar-path comment fixed; ensure-agent-device uses npm prefix -g (npm 9+); expo_ensure_running preserves temp logs on failure. Not-actioned (correct as-is): lockfile release (signals route to exit->release; SIGKILL covered by mtime), dumpsys (action=all runs once), persistRun CAS re-read (required after conflict), test-recorder dedup edge / buildNavigationPlan scan / loadExperience forceReload (dev-only/negligible). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A 13-subsystem multi-agent audit of the repo surfaced 86 confirmed findings (adversarially verified; 18 plausible-but-wrong findings refuted). This PR resolves the 1 HIGH, all 16 MEDIUM, and the high-value perf/low/doc items — ~42 findings, each with regression tests where unit-testable.
tscclean, Swift runnerxcodebuild build-for-testingSUCCEEDEDgetTree()fix confirmed over CDP against the booted Bridgeless + Reanimated test app (returned the realAppContainertree, not a LogBox shell)🔴 HIGH
collect-feedback.shredact()failed open on macOS — an invalidsedbracket range made the secret stage error on every run, leakingghp_/AKIA/JWT/Bearer/sk_tokens into the public feedback issue. Now a singlesedprogram that fails closed ([REDACTED_FAILED]). Added a bash regression test that proves the leak, then proves it closed.🟠 MEDIUM (16)
Correctness:
device_batchswipe→real swipe; iOS/Android HTTP request timeouts; ref-map@refage gate →STALE_REF; iOS screenshot png format; NaN tap-coord guard; repair-engine grammar realigned to the failure parser (quoted/commented testIDs); experience candidate/import-id collisions, ghost-recovery idempotency allow-list, redaction quoted-JSON/object-auth gaps, PII over-redaction;cross_platform_verifyFAIL →ok:false;runMaestroInlineB59 tiered fallback; unfilteredgetTree()multi-renderer walk; per-project nav-graph strike namespacing; swifttextInputAtquery restriction; EAS portablestat.⚡ Performance
meta.timings_mshelper + scrollintoview instrumentation (closes a CLAUDE.md mandate that had zero implementations);object_inspectconcurrent child fetch;nav_graph gosingle graph read (was up to 4 disk re-parses/call); connect candidate loopO(n²)→indexed;auto_loginpoll-until-ready instead of a blind 3s wait.🟡 LOW / docs
Guarded
JSON.parse×2;navigateToloop depth cap; sidecarlastSeenMtimeMsre-seed;proof_stepno-session verify;device_recordpath-traversal guard;device_findrecoveredTiersurfaced on all outcomes;detectPrerequisiteswhole-word match;learned-actions --maxNaN fallback;collect-feedbackgrep -cdouble-zero; IPv4/6 loopback alignment; tool-count drift (51/74 → 75); REACT_READY renderer range 1-5 → 1-20; repair-budget windowed count.Swift (compile-verified)
rn-fast-runnernow answersGET /healthdirectly (was unparseable → liveness always readstale)snapshotHasFocususesas?notas!(a force-cast trap is uncatchable by the Obj-C exception catcher)Deferred
~20 lower-value / moderate-risk items (e.g. logger async,
maestro_test_allparallelism, maestro pass/fail string detection, CAS/cache reuse, lockfile/connectWs lifecycle; plus genuinely cosmetic/working-as-intended ones like thefingerprint"hermes" default) were deliberately deferred to avoid rushing regressions into a shipping plugin — tracked for a focused, well-tested follow-up.Testing
npm test→ 1558 passnpx tsc --noEmit→ cleanxcodebuild build-for-testing(rn-fast-runner) → TEST BUILD SUCCEEDEDgetTree()on the booted simulator🤖 Generated with Claude Code